class MoodType {
  int? id;
  String? name;
  String? icon;
  String? color;
  String? description;

  MoodType({
    this.id,
    this.name,
    this.icon,
    this.color,
    this.description,
  });

  factory MoodType.fromJson(Map<String, dynamic> json) => MoodType(
    id: json['id'],
    name: json['name'],
    icon: json['icon'],
    color: json['color'],
    description: json['description'],
  );

  Map<String, dynamic> toJson() => {
    'id': id,
    'name': name,
    'icon': icon,
    'color': color,
    'description': description,
  };

  static MoodType happy() {
    return MoodType(
      name: 'happy',
      icon: '😊'
    );
  }

  static MoodType angry() {
    return MoodType(
      name: 'angry',
      icon: '😡'
    );
  }

  @override
  String toString() {
    return 'MoodType{id: $id, name: $name, icon: $icon, color: $color, description: $description}';
  }


  // @override
  // bool operator ==(Object other) {
  //   if(other is! MoodType) {
  //     return false;
  //   }
  //   return other.id == id || other.name == name;
  // }
}
